.class Lcom/netease/util/PicUtils$1;
.super Ljava/lang/Object;
.source "PicUtils.java"

# interfaces
.implements Ljava/lang/Runnable;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/netease/util/PicUtils;->saveBitmap(Landroid/graphics/Bitmap;Ljava/lang/String;Ljava/lang/String;ZZ)Landroid/graphics/Bitmap;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field private final synthetic val$f:Ljava/io/File;

.field private final synthetic val$saveBitmap:Landroid/graphics/Bitmap;


# direct methods
.method constructor <init>(Ljava/io/File;Landroid/graphics/Bitmap;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 1
    iput-object p1, p0, Lcom/netease/util/PicUtils$1;->val$f:Ljava/io/File;

    iput-object p2, p0, Lcom/netease/util/PicUtils$1;->val$saveBitmap:Landroid/graphics/Bitmap;

    .line 213
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public run()V
    .locals 6

    .prologue
    .line 217
    const/4 v0, 0x0

    .line 219
    .local v0, bOut:Ljava/io/BufferedOutputStream;
    :try_start_0
    new-instance v1, Ljava/io/BufferedOutputStream;

    new-instance v3, Ljava/io/FileOutputStream;

    iget-object v4, p0, Lcom/netease/util/PicUtils$1;->val$f:Ljava/io/File;

    invoke-direct {v3, v4}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V

    invoke-direct {v1, v3}, Ljava/io/BufferedOutputStream;-><init>(Ljava/io/OutputStream;)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 220
    .end local v0           #bOut:Ljava/io/BufferedOutputStream;
    .local v1, bOut:Ljava/io/BufferedOutputStream;
    :try_start_1
    iget-object v3, p0, Lcom/netease/util/PicUtils$1;->val$saveBitmap:Landroid/graphics/Bitmap;

    sget-object v4, Landroid/graphics/Bitmap$CompressFormat;->PNG:Landroid/graphics/Bitmap$CompressFormat;

    const/16 v5, 0x64

    invoke-virtual {v3, v4, v5, v1}, Landroid/graphics/Bitmap;->compress(Landroid/graphics/Bitmap$CompressFormat;ILjava/io/OutputStream;)Z

    .line 221
    invoke-virtual {v1}, Ljava/io/BufferedOutputStream;->flush()V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_4

    .line 225
    if-eqz v1, :cond_2

    .line 227
    :try_start_2
    invoke-virtual {v1}, Ljava/io/BufferedOutputStream;->close()V
    :try_end_2
    .catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_2

    move-object v0, v1

    .line 233
    .end local v1           #bOut:Ljava/io/BufferedOutputStream;
    .restart local v0       #bOut:Ljava/io/BufferedOutputStream;
    :cond_0
    :goto_0
    return-void

    .line 222
    :catch_0
    move-exception v2

    .line 223
    .local v2, e:Ljava/lang/Exception;
    :goto_1
    :try_start_3
    const-string v3, "PicUtil"

    const-string v4, "saveBitmap error!!!!!"

    invoke-static {v3, v4, v2}, Lcom/netease/util/Logger;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    .line 225
    if-eqz v0, :cond_0

    .line 227
    :try_start_4
    invoke-virtual {v0}, Ljava/io/BufferedOutputStream;->close()V
    :try_end_4
    .catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_1

    goto :goto_0

    .line 228
    :catch_1
    move-exception v3

    goto :goto_0

    .line 224
    .end local v2           #e:Ljava/lang/Exception;
    :catchall_0
    move-exception v3

    .line 225
    :goto_2
    if-eqz v0, :cond_1

    .line 227
    :try_start_5
    invoke-virtual {v0}, Ljava/io/BufferedOutputStream;->close()V
    :try_end_5
    .catch Ljava/io/IOException; {:try_start_5 .. :try_end_5} :catch_3

    .line 232
    :cond_1
    :goto_3
    throw v3

    .line 228
    .end local v0           #bOut:Ljava/io/BufferedOutputStream;
    .restart local v1       #bOut:Ljava/io/BufferedOutputStream;
    :catch_2
    move-exception v3

    move-object v0, v1

    .end local v1           #bOut:Ljava/io/BufferedOutputStream;
    .restart local v0       #bOut:Ljava/io/BufferedOutputStream;
    goto :goto_0

    :catch_3
    move-exception v4

    goto :goto_3

    .line 224
    .end local v0           #bOut:Ljava/io/BufferedOutputStream;
    .restart local v1       #bOut:Ljava/io/BufferedOutputStream;
    :catchall_1
    move-exception v3

    move-object v0, v1

    .end local v1           #bOut:Ljava/io/BufferedOutputStream;
    .restart local v0       #bOut:Ljava/io/BufferedOutputStream;
    goto :goto_2

    .line 222
    .end local v0           #bOut:Ljava/io/BufferedOutputStream;
    .restart local v1       #bOut:Ljava/io/BufferedOutputStream;
    :catch_4
    move-exception v2

    move-object v0, v1

    .end local v1           #bOut:Ljava/io/BufferedOutputStream;
    .restart local v0       #bOut:Ljava/io/BufferedOutputStream;
    goto :goto_1

    .end local v0           #bOut:Ljava/io/BufferedOutputStream;
    .restart local v1       #bOut:Ljava/io/BufferedOutputStream;
    :cond_2
    move-object v0, v1

    .end local v1           #bOut:Ljava/io/BufferedOutputStream;
    .restart local v0       #bOut:Ljava/io/BufferedOutputStream;
    goto :goto_0
.end method
